<extend name="Layout:layout_edit" />
<block name="body_content_block">
    <form action="{:AddonU('SMS/server_edit_save')}" method="post">
        <table>
            <if condition="$isSuperAdmin">
                <tr><th>租户ID：</th><td><select name="siteID" title="请选择租户" data-url="{:AddonU('Admin/get_admin_json')}" data-value="{$data.siteID}"></select></td></tr>
                <else/>
                <tr style="display: none;"><input type="hidden" name="siteID" value="{$loginData.siteID}" /></td></tr>
            </if>
            <tr>
                <th>服务器名称：</th><td>
                <input type="text" class="easyui-textbox" name="serverName" placeholder="请输入服务器名称" value="{$data.serverName}" title="请填写服务器名称" required />
            </td></tr>
            <tr>
                <th>服务器地址：</th><td>
                <input type="text" class="easyui-textbox" name="host" placeholder="请输入服务器地址" value="{$data.host}" title="请填写服务器地址!" required />
            </td></tr>
            <tr>
                <th>端口号：</th><td>
                <input type="text" class="easyui-textbox" name="port" placeholder="请输入端口号" value="{$data.port}" title="请填写端口号!" required />
            </td></tr>
            <!--
            <tr>
                <th>用户名：</th><td>
                <input type="text" class="easyui-textbox" name="loginID" placeholder="请输入用户名" value="{$data.loginID}" title="请填写3-16个字符!" />
            </td></tr>
            <tr>
                <th>密码：</th><td>
                <input type="password" name="password" placeholder="请输入密码" title="请填写6-16个字符!" />
            </td></tr>
            -->
            <tr>
                <th>每条计费字符数：</th><td>
                <input type="text" class="easyui-textbox" name="contentLength" placeholder="请输入每条计费字符数" value="{$data.contentLength|default='60'}" title="请填写数字!" required />
            </td></tr>
            <tr>
                <th>发送间隔(秒)：</th><td>
                <input type="text" class="easyui-textbox" name="sendInterval" placeholder="请输入发送间隔" value="{$data.sendInterval|default='5'}" title="请填写数字!" required />
            </td></tr>
            <tr>
                <th>备注信息：</th><td>
                <input type="text" class="easyui-textbox" name="remark" placeholder="请输入备注信息" value="{$data.remark}" />
            </td></tr>
        </table>
        <input type='hidden' value='{$data.id}' name='id' />
    </form>
</block>
<block name="body_after_block">
    <script>
    ajax_load_options({selector:'select[name="siteID"]', def_option: '选择租户'});
    if($('input[name="serverName"]').val()){
        $('input[name="serverName"]').prop('readonly',true);
    }
    //$('input[name="password"]').val('{$data.password}');
</script>
</block>